function [] = edge_detection_canny(input,output,th,tl)
M_ORG = imread(input);
[h,w,d] = size(M_ORG);
if (d  == 3)
        M_ORG = M_ORG(:,:,1)*0.3 + M_ORG(:,:,2)*0.6 + M_ORG(:,:,3)*0.1;
end

M_GAUSSIAN = gaussian(M_ORG);
[MAG,PHASE] = sobel(M_GAUSSIAN);
M_EDGE = non_max_supression(MAG,PHASE,th);
M_FINAL = canny_trace_edge(M_EDGE,MAG,PHASE,tl);

imwrite(M_FINAL,output);
